home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / lib / python2.4 / lib-tk / Tix.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2007-04-29  |  79.9 KB  |  2,041 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.4)
  3.  
  4. from Tkinter import *
  5. from Tkinter import _flatten, _cnfmerge, _default_root
  6. if TkVersion < 3.9990000000000001:
  7.     raise ImportError, 'This version of Tix.py requires Tk 4.0 or higher'
  8.  
  9. import _tkinter
  10. WINDOW = 'window'
  11. TEXT = 'text'
  12. STATUS = 'status'
  13. IMMEDIATE = 'immediate'
  14. IMAGE = 'image'
  15. IMAGETEXT = 'imagetext'
  16. BALLOON = 'balloon'
  17. AUTO = 'auto'
  18. ACROSSTOP = 'acrosstop'
  19. TCL_DONT_WAIT = 1 << 1
  20. TCL_WINDOW_EVENTS = 1 << 2
  21. TCL_FILE_EVENTS = 1 << 3
  22. TCL_TIMER_EVENTS = 1 << 4
  23. TCL_IDLE_EVENTS = 1 << 5
  24. TCL_ALL_EVENTS = 0
  25. import Tkinter
  26. import os
  27.  
  28. class tixCommand:
  29.     """The tix commands provide access to miscellaneous  elements
  30.     of  Tix's  internal state and the Tix application context.
  31.     Most of the information manipulated by these  commands pertains
  32.     to  the  application  as a whole, or to a screen or
  33.     display, rather than to a particular window.
  34.  
  35.     This is a mixin class, assumed to be mixed to Tkinter.Tk
  36.     that supports the self.tk.call method.
  37.     """
  38.     
  39.     def tix_addbitmapdir(self, directory):
  40.         '''Tix maintains a list of directories under which
  41.         the  tix_getimage  and tix_getbitmap commands will
  42.         search for image files. The standard bitmap  directory
  43.         is $TIX_LIBRARY/bitmaps. The addbitmapdir command
  44.         adds directory into this list. By  using  this
  45.         command, the  image  files  of an applications can
  46.         also be located using the tix_getimage or tix_getbitmap
  47.         command.
  48.         '''
  49.         return self.tk.call('tix', 'addbitmapdir', directory)
  50.  
  51.     
  52.     def tix_cget(self, option):
  53.         '''Returns  the  current  value  of the configuration
  54.         option given by option. Option may be  any  of  the
  55.         options described in the CONFIGURATION OPTIONS section.
  56.         '''
  57.         return self.tk.call('tix', 'cget', option)
  58.  
  59.     
  60.     def tix_configure(self, cnf = None, **kw):
  61.         '''Query or modify the configuration options of the Tix application
  62.         context. If no option is specified, returns a dictionary all of the
  63.         available options.  If option is specified with no value, then the
  64.         command returns a list describing the one named option (this list
  65.         will be identical to the corresponding sublist of the value
  66.         returned if no option is specified).  If one or more option-value
  67.         pairs are specified, then the command modifies the given option(s)
  68.         to have the given value(s); in this case the command returns an
  69.         empty string. Option may be any of the configuration options.
  70.         '''
  71.         if kw:
  72.             cnf = _cnfmerge((cnf, kw))
  73.         elif cnf:
  74.             cnf = _cnfmerge(cnf)
  75.         
  76.         if cnf is None:
  77.             cnf = { }
  78.             for x in self.tk.split(self.tk.call('tix', 'configure')):
  79.                 cnf[x[0][1:]] = (x[0][1:],) + x[1:]
  80.             
  81.             return cnf
  82.         
  83.         if isinstance(cnf, StringType):
  84.             x = self.tk.split(self.tk.call('tix', 'configure', '-' + cnf))
  85.             return (x[0][1:],) + x[1:]
  86.         
  87.         return self.tk.call(('tix', 'configure') + self._options(cnf))
  88.  
  89.     
  90.     def tix_filedialog(self, dlgclass = None):
  91.         '''Returns the file selection dialog that may be shared among
  92.         different calls from this application.  This command will create a
  93.         file selection dialog widget when it is called the first time. This
  94.         dialog will be returned by all subsequent calls to tix_filedialog.
  95.         An optional dlgclass parameter can be passed to specified what type
  96.         of file selection dialog widget is desired. Possible options are
  97.         tix FileSelectDialog or tixExFileSelectDialog.
  98.         '''
  99.         if dlgclass is not None:
  100.             return self.tk.call('tix', 'filedialog', dlgclass)
  101.         else:
  102.             return self.tk.call('tix', 'filedialog')
  103.  
  104.     
  105.     def tix_getbitmap(self, name):
  106.         """Locates a bitmap file of the name name.xpm or name in one of the
  107.         bitmap directories (see the tix_addbitmapdir command above).  By
  108.         using tix_getbitmap, you can avoid hard coding the pathnames of the
  109.         bitmap files in your application. When successful, it returns the
  110.         complete pathname of the bitmap file, prefixed with the character
  111.         '@'.  The returned value can be used to configure the -bitmap
  112.         option of the TK and Tix widgets.
  113.         """
  114.         return self.tk.call('tix', 'getbitmap', name)
  115.  
  116.     
  117.     def tix_getimage(self, name):
  118.         '''Locates an image file of the name name.xpm, name.xbm or name.ppm
  119.         in one of the bitmap directories (see the addbitmapdir command
  120.         above). If more than one file with the same name (but different
  121.         extensions) exist, then the image type is chosen according to the
  122.         depth of the X display: xbm images are chosen on monochrome
  123.         displays and color images are chosen on color displays. By using
  124.         tix_ getimage, you can advoid hard coding the pathnames of the
  125.         image files in your application. When successful, this command
  126.         returns the name of the newly created image, which can be used to
  127.         configure the -image option of the Tk and Tix widgets.
  128.         '''
  129.         return self.tk.call('tix', 'getimage', name)
  130.  
  131.     
  132.     def tix_option_get(self, name):
  133.         '''Gets  the options  manitained  by  the  Tix
  134.         scheme mechanism. Available options include:
  135.  
  136.             active_bg       active_fg      bg
  137.             bold_font       dark1_bg       dark1_fg
  138.             dark2_bg        dark2_fg       disabled_fg
  139.             fg              fixed_font     font
  140.             inactive_bg     inactive_fg    input1_bg
  141.             input2_bg       italic_font    light1_bg
  142.             light1_fg       light2_bg      light2_fg
  143.             menu_font       output1_bg     output2_bg
  144.             select_bg       select_fg      selector
  145.             '''
  146.         return self.tk.call('tix', 'option', 'get', name)
  147.  
  148.     
  149.     def tix_resetoptions(self, newScheme, newFontSet, newScmPrio = None):
  150.         '''Resets the scheme and fontset of the Tix application to
  151.         newScheme and newFontSet, respectively.  This affects only those
  152.         widgets created after this call. Therefore, it is best to call the
  153.         resetoptions command before the creation of any widgets in a Tix
  154.         application.
  155.  
  156.         The optional parameter newScmPrio can be given to reset the
  157.         priority level of the Tk options set by the Tix schemes.
  158.  
  159.         Because of the way Tk handles the X option database, after Tix has
  160.         been has imported and inited, it is not possible to reset the color
  161.         schemes and font sets using the tix config command.  Instead, the
  162.         tix_resetoptions command must be used.
  163.         '''
  164.         if newScmPrio is not None:
  165.             return self.tk.call('tix', 'resetoptions', newScheme, newFontSet, newScmPrio)
  166.         else:
  167.             return self.tk.call('tix', 'resetoptions', newScheme, newFontSet)
  168.  
  169.  
  170.  
  171. class Tk(Tkinter.Tk, tixCommand):
  172.     '''Toplevel widget of Tix which represents mostly the main window
  173.     of an application. It has an associated Tcl interpreter.'''
  174.     
  175.     def __init__(self, screenName = None, baseName = None, className = 'Tix'):
  176.         Tkinter.Tk.__init__(self, screenName, baseName, className)
  177.         tixlib = os.environ.get('TIX_LIBRARY')
  178.         self.tk.eval('global auto_path; lappend auto_path [file dir [info nameof]]')
  179.         if tixlib is not None:
  180.             self.tk.eval('global auto_path; lappend auto_path {%s}' % tixlib)
  181.             self.tk.eval('global tcl_pkgPath; lappend tcl_pkgPath {%s}' % tixlib)
  182.         
  183.         self.tk.eval('package require Tix')
  184.  
  185.     
  186.     def destroy(self):
  187.         self.protocol('WM_DELETE_WINDOW', '')
  188.         Tkinter.Tk.destroy(self)
  189.  
  190.  
  191.  
  192. class Form:
  193.     '''The Tix Form geometry manager
  194.  
  195.     Widgets can be arranged by specifying attachments to other widgets.
  196.     See Tix documentation for complete details'''
  197.     
  198.     def config(self, cnf = { }, **kw):
  199.         self.tk.call('tixForm', self._w, *self._options(cnf, kw))
  200.  
  201.     form = config
  202.     
  203.     def __setitem__(self, key, value):
  204.         Form.form(self, {
  205.             key: value })
  206.  
  207.     
  208.     def check(self):
  209.         return self.tk.call('tixForm', 'check', self._w)
  210.  
  211.     
  212.     def forget(self):
  213.         self.tk.call('tixForm', 'forget', self._w)
  214.  
  215.     
  216.     def grid(self, xsize = 0, ysize = 0):
  217.         if not xsize and not ysize:
  218.             x = self.tk.call('tixForm', 'grid', self._w)
  219.             y = self.tk.splitlist(x)
  220.             z = ()
  221.             for x in y:
  222.                 z = z + (self.tk.getint(x),)
  223.             
  224.             return z
  225.         
  226.         return self.tk.call('tixForm', 'grid', self._w, xsize, ysize)
  227.  
  228.     
  229.     def info(self, option = None):
  230.         if not option:
  231.             return self.tk.call('tixForm', 'info', self._w)
  232.         
  233.         if option[0] != '-':
  234.             option = '-' + option
  235.         
  236.         return self.tk.call('tixForm', 'info', self._w, option)
  237.  
  238.     
  239.     def slaves(self):
  240.         return map(self._nametowidget, self.tk.splitlist(self.tk.call('tixForm', 'slaves', self._w)))
  241.  
  242.  
  243. Tkinter.Widget.__bases__ = Tkinter.Widget.__bases__ + (Form,)
  244.  
  245. class TixWidget(Tkinter.Widget):
  246.     """A TixWidget class is used to package all (or most) Tix widgets.
  247.  
  248.     Widget initialization is extended in two ways:
  249.        1) It is possible to give a list of options which must be part of
  250.        the creation command (so called Tix 'static' options). These cannot be
  251.        given as a 'config' command later.
  252.        2) It is possible to give the name of an existing TK widget. These are
  253.        child widgets created automatically by a Tix mega-widget. The Tk call
  254.        to create these widgets is therefore bypassed in TixWidget.__init__
  255.  
  256.     Both options are for use by subclasses only.
  257.     """
  258.     
  259.     def __init__(self, master = None, widgetName = None, static_options = None, cnf = { }, kw = { }):
  260.         if kw:
  261.             cnf = _cnfmerge((cnf, kw))
  262.         else:
  263.             cnf = _cnfmerge(cnf)
  264.         extra = ()
  265.         if static_options:
  266.             static_options.append('options')
  267.         else:
  268.             static_options = [
  269.                 'options']
  270.         for k, v in cnf.items()[:]:
  271.             if k in static_options:
  272.                 extra = extra + ('-' + k, v)
  273.                 del cnf[k]
  274.                 continue
  275.         
  276.         self.widgetName = widgetName
  277.         Widget._setup(self, master, cnf)
  278.         if widgetName:
  279.             self.tk.call(widgetName, self._w, *extra)
  280.         
  281.         if cnf:
  282.             Widget.config(self, cnf)
  283.         
  284.         self.subwidget_list = { }
  285.  
  286.     
  287.     def __getattr__(self, name):
  288.         if self.subwidget_list.has_key(name):
  289.             return self.subwidget_list[name]
  290.         
  291.         raise AttributeError, name
  292.  
  293.     
  294.     def set_silent(self, value):
  295.         '''Set a variable without calling its action routine'''
  296.         self.tk.call('tixSetSilent', self._w, value)
  297.  
  298.     
  299.     def subwidget(self, name):
  300.         '''Return the named subwidget (which must have been created by
  301.         the sub-class).'''
  302.         n = self._subwidget_name(name)
  303.         if not n:
  304.             raise TclError, 'Subwidget ' + name + ' not child of ' + self._name
  305.         
  306.         n = n[len(self._w) + 1:]
  307.         return self._nametowidget(n)
  308.  
  309.     
  310.     def subwidgets_all(self):
  311.         '''Return all subwidgets.'''
  312.         names = self._subwidget_names()
  313.         if not names:
  314.             return []
  315.         
  316.         retlist = []
  317.         for name in names:
  318.             name = name[len(self._w) + 1:]
  319.             
  320.             try:
  321.                 retlist.append(self._nametowidget(name))
  322.             continue
  323.             continue
  324.  
  325.         
  326.         return retlist
  327.  
  328.     
  329.     def _subwidget_name(self, name):
  330.         '''Get a subwidget name (returns a String, not a Widget !)'''
  331.         
  332.         try:
  333.             return self.tk.call(self._w, 'subwidget', name)
  334.         except TclError:
  335.             return None
  336.  
  337.  
  338.     
  339.     def _subwidget_names(self):
  340.         '''Return the name of all subwidgets.'''
  341.         
  342.         try:
  343.             x = self.tk.call(self._w, 'subwidgets', '-all')
  344.             return self.tk.split(x)
  345.         except TclError:
  346.             return None
  347.  
  348.  
  349.     
  350.     def config_all(self, option, value):
  351.         '''Set configuration options for all subwidgets (and self).'''
  352.         if option == '':
  353.             return None
  354.         elif not isinstance(option, StringType):
  355.             option = repr(option)
  356.         
  357.         if not isinstance(value, StringType):
  358.             value = repr(value)
  359.         
  360.         names = self._subwidget_names()
  361.         for name in names:
  362.             self.tk.call(name, 'configure', '-' + option, value)
  363.         
  364.  
  365.     
  366.     def image_create(self, imgtype, cnf = { }, master = None, **kw):
  367.         if not master:
  368.             master = Tkinter._default_root
  369.             if not master:
  370.                 raise RuntimeError, 'Too early to create image'
  371.             
  372.         
  373.         if kw and cnf:
  374.             cnf = _cnfmerge((cnf, kw))
  375.         elif kw:
  376.             cnf = kw
  377.         
  378.         options = ()
  379.         for k, v in cnf.items():
  380.             if callable(v):
  381.                 v = self._register(v)
  382.             
  383.             options = options + ('-' + k, v)
  384.         
  385.         return master.tk.call(('image', 'create', imgtype) + options)
  386.  
  387.     
  388.     def image_delete(self, imgname):
  389.         
  390.         try:
  391.             self.tk.call('image', 'delete', imgname)
  392.         except TclError:
  393.             pass
  394.  
  395.  
  396.  
  397.  
  398. class TixSubWidget(TixWidget):
  399.     '''Subwidget class.
  400.  
  401.     This is used to mirror child widgets automatically created
  402.     by Tix/Tk as part of a mega-widget in Python (which is not informed
  403.     of this)'''
  404.     
  405.     def __init__(self, master, name, destroy_physically = 1, check_intermediate = 1):
  406.         if check_intermediate:
  407.             path = master._subwidget_name(name)
  408.             
  409.             try:
  410.                 path = path[len(master._w) + 1:]
  411.                 plist = path.split('.')
  412.             plist = []
  413.  
  414.         
  415.         self.destroy_physically = destroy_physically
  416.  
  417.     
  418.     def destroy(self):
  419.         for c in self.children.values():
  420.             c.destroy()
  421.         
  422.         if self.master.children.has_key(self._name):
  423.             del self.master.children[self._name]
  424.         
  425.         if self.master.subwidget_list.has_key(self._name):
  426.             del self.master.subwidget_list[self._name]
  427.         
  428.         if self.destroy_physically:
  429.             self.tk.call('destroy', self._w)
  430.         
  431.  
  432.  
  433.  
  434. def _lst2dict(lst):
  435.     dict = { }
  436.     for x in lst:
  437.         dict[x[0][1:]] = (x[0][1:],) + x[1:]
  438.     
  439.     return dict
  440.  
  441.  
  442. class DisplayStyle:
  443.     '''DisplayStyle - handle configuration options shared by
  444.     (multiple) Display Items'''
  445.     
  446.     def __init__(self, itemtype, cnf = { }, **kw):
  447.         master = _default_root
  448.         if not master and cnf.has_key('refwindow'):
  449.             master = cnf['refwindow']
  450.         elif not master and kw.has_key('refwindow'):
  451.             master = kw['refwindow']
  452.         elif not master:
  453.             raise RuntimeError, 'Too early to create display style: no root window'
  454.         
  455.         self.tk = master.tk
  456.         self.stylename = self.tk.call('tixDisplayStyle', itemtype, *self._options(cnf, kw))
  457.  
  458.     
  459.     def __str__(self):
  460.         return self.stylename
  461.  
  462.     
  463.     def _options(self, cnf, kw):
  464.         if kw and cnf:
  465.             cnf = _cnfmerge((cnf, kw))
  466.         elif kw:
  467.             cnf = kw
  468.         
  469.         opts = ()
  470.         for k, v in cnf.items():
  471.             opts = opts + ('-' + k, v)
  472.         
  473.         return opts
  474.  
  475.     
  476.     def delete(self):
  477.         self.tk.call(self.stylename, 'delete')
  478.  
  479.     
  480.     def __setitem__(self, key, value):
  481.         self.tk.call(self.stylename, 'configure', '-%s' % key, value)
  482.  
  483.     
  484.     def config(self, cnf = { }, **kw):
  485.         return _lst2dict(self.tk.split(self.tk.call(self.stylename, 'configure', *self._options(cnf, kw))))
  486.  
  487.     
  488.     def __getitem__(self, key):
  489.         return self.tk.call(self.stylename, 'cget', '-%s' % key)
  490.  
  491.  
  492.  
  493. class Balloon(TixWidget):
  494.     '''Balloon help widget.
  495.  
  496.     Subwidget       Class
  497.     ---------       -----
  498.     label           Label
  499.     message         Message'''
  500.     
  501.     def __init__(self, master = None, cnf = { }, **kw):
  502.         static = [
  503.             'options',
  504.             'installcolormap',
  505.             'initwait',
  506.             'statusbar',
  507.             'cursor']
  508.         TixWidget.__init__(self, master, 'tixBalloon', static, cnf, kw)
  509.         self.subwidget_list['label'] = _dummyLabel(self, 'label', destroy_physically = 0)
  510.         self.subwidget_list['message'] = _dummyLabel(self, 'message', destroy_physically = 0)
  511.  
  512.     
  513.     def bind_widget(self, widget, cnf = { }, **kw):
  514.         '''Bind balloon widget to another.
  515.         One balloon widget may be bound to several widgets at the same time'''
  516.         self.tk.call(self._w, 'bind', widget._w, *self._options(cnf, kw))
  517.  
  518.     
  519.     def unbind_widget(self, widget):
  520.         self.tk.call(self._w, 'unbind', widget._w)
  521.  
  522.  
  523.  
  524. class ButtonBox(TixWidget):
  525.     '''ButtonBox - A container for pushbuttons.
  526.     Subwidgets are the buttons added with the add method.
  527.     '''
  528.     
  529.     def __init__(self, master = None, cnf = { }, **kw):
  530.         TixWidget.__init__(self, master, 'tixButtonBox', [
  531.             'orientation',
  532.             'options'], cnf, kw)
  533.  
  534.     
  535.     def add(self, name, cnf = { }, **kw):
  536.         '''Add a button with given name to box.'''
  537.         btn = self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
  538.         self.subwidget_list[name] = _dummyButton(self, name)
  539.         return btn
  540.  
  541.     
  542.     def invoke(self, name):
  543.         if self.subwidget_list.has_key(name):
  544.             self.tk.call(self._w, 'invoke', name)
  545.         
  546.  
  547.  
  548.  
  549. class ComboBox(TixWidget):
  550.     '''ComboBox - an Entry field with a dropdown menu. The user can select a
  551.     choice by either typing in the entry subwdget or selecting from the
  552.     listbox subwidget.
  553.  
  554.     Subwidget       Class
  555.     ---------       -----
  556.     entry       Entry
  557.     arrow       Button
  558.     slistbox    ScrolledListBox
  559.     tick        Button
  560.     cross       Button : present if created with the fancy option'''
  561.     
  562.     def __init__(self, master = None, cnf = { }, **kw):
  563.         TixWidget.__init__(self, master, 'tixComboBox', [
  564.             'editable',
  565.             'dropdown',
  566.             'fancy',
  567.             'options'], cnf, kw)
  568.         self.subwidget_list['label'] = _dummyLabel(self, 'label')
  569.         self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
  570.         self.subwidget_list['arrow'] = _dummyButton(self, 'arrow')
  571.         self.subwidget_list['slistbox'] = _dummyScrolledListBox(self, 'slistbox')
  572.         
  573.         try:
  574.             self.subwidget_list['tick'] = _dummyButton(self, 'tick')
  575.             self.subwidget_list['cross'] = _dummyButton(self, 'cross')
  576.         except TypeError:
  577.             pass
  578.  
  579.  
  580.     
  581.     def add_history(self, str):
  582.         self.tk.call(self._w, 'addhistory', str)
  583.  
  584.     
  585.     def append_history(self, str):
  586.         self.tk.call(self._w, 'appendhistory', str)
  587.  
  588.     
  589.     def insert(self, index, str):
  590.         self.tk.call(self._w, 'insert', index, str)
  591.  
  592.     
  593.     def pick(self, index):
  594.         self.tk.call(self._w, 'pick', index)
  595.  
  596.  
  597.  
  598. class Control(TixWidget):
  599.     '''Control - An entry field with value change arrows.  The user can
  600.     adjust the value by pressing the two arrow buttons or by entering
  601.     the value directly into the entry. The new value will be checked
  602.     against the user-defined upper and lower limits.
  603.  
  604.     Subwidget       Class
  605.     ---------       -----
  606.     incr       Button
  607.     decr       Button
  608.     entry       Entry
  609.     label       Label'''
  610.     
  611.     def __init__(self, master = None, cnf = { }, **kw):
  612.         TixWidget.__init__(self, master, 'tixControl', [
  613.             'options'], cnf, kw)
  614.         self.subwidget_list['incr'] = _dummyButton(self, 'incr')
  615.         self.subwidget_list['decr'] = _dummyButton(self, 'decr')
  616.         self.subwidget_list['label'] = _dummyLabel(self, 'label')
  617.         self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
  618.  
  619.     
  620.     def decrement(self):
  621.         self.tk.call(self._w, 'decr')
  622.  
  623.     
  624.     def increment(self):
  625.         self.tk.call(self._w, 'incr')
  626.  
  627.     
  628.     def invoke(self):
  629.         self.tk.call(self._w, 'invoke')
  630.  
  631.     
  632.     def update(self):
  633.         self.tk.call(self._w, 'update')
  634.  
  635.  
  636.  
  637. class DirList(TixWidget):
  638.     '''DirList - displays a list view of a directory, its previous
  639.     directories and its sub-directories. The user can choose one of
  640.     the directories displayed in the list or change to another directory.
  641.  
  642.     Subwidget       Class
  643.     ---------       -----
  644.     hlist       HList
  645.     hsb              Scrollbar
  646.     vsb              Scrollbar'''
  647.     
  648.     def __init__(self, master, cnf = { }, **kw):
  649.         TixWidget.__init__(self, master, 'tixDirList', [
  650.             'options'], cnf, kw)
  651.         self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
  652.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  653.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  654.  
  655.     
  656.     def chdir(self, dir):
  657.         self.tk.call(self._w, 'chdir', dir)
  658.  
  659.  
  660.  
  661. class DirTree(TixWidget):
  662.     '''DirTree - Directory Listing in a hierarchical view.
  663.     Displays a tree view of a directory, its previous directories and its
  664.     sub-directories. The user can choose one of the directories displayed
  665.     in the list or change to another directory.
  666.  
  667.     Subwidget       Class
  668.     ---------       -----
  669.     hlist           HList
  670.     hsb             Scrollbar
  671.     vsb             Scrollbar'''
  672.     
  673.     def __init__(self, master, cnf = { }, **kw):
  674.         TixWidget.__init__(self, master, 'tixDirTree', [
  675.             'options'], cnf, kw)
  676.         self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
  677.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  678.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  679.  
  680.     
  681.     def chdir(self, dir):
  682.         self.tk.call(self._w, 'chdir', dir)
  683.  
  684.  
  685.  
  686. class DirSelectBox(TixWidget):
  687.     '''DirSelectBox - Motif style file select box.
  688.     It is generally used for
  689.     the user to choose a file. FileSelectBox stores the files mostly
  690.     recently selected into a ComboBox widget so that they can be quickly
  691.     selected again.
  692.  
  693.     Subwidget       Class
  694.     ---------       -----
  695.     selection       ComboBox
  696.     filter          ComboBox
  697.     dirlist         ScrolledListBox
  698.     filelist        ScrolledListBox'''
  699.     
  700.     def __init__(self, master, cnf = { }, **kw):
  701.         TixWidget.__init__(self, master, 'tixDirSelectBox', [
  702.             'options'], cnf, kw)
  703.         self.subwidget_list['dirlist'] = _dummyDirList(self, 'dirlist')
  704.         self.subwidget_list['dircbx'] = _dummyFileComboBox(self, 'dircbx')
  705.  
  706.  
  707.  
  708. class ExFileSelectBox(TixWidget):
  709.     '''ExFileSelectBox - MS Windows style file select box.
  710.     It provides an convenient method for the user to select files.
  711.  
  712.     Subwidget       Class
  713.     ---------       -----
  714.     cancel       Button
  715.     ok              Button
  716.     hidden       Checkbutton
  717.     types       ComboBox
  718.     dir              ComboBox
  719.     file       ComboBox
  720.     dirlist       ScrolledListBox
  721.     filelist       ScrolledListBox'''
  722.     
  723.     def __init__(self, master, cnf = { }, **kw):
  724.         TixWidget.__init__(self, master, 'tixExFileSelectBox', [
  725.             'options'], cnf, kw)
  726.         self.subwidget_list['cancel'] = _dummyButton(self, 'cancel')
  727.         self.subwidget_list['ok'] = _dummyButton(self, 'ok')
  728.         self.subwidget_list['hidden'] = _dummyCheckbutton(self, 'hidden')
  729.         self.subwidget_list['types'] = _dummyComboBox(self, 'types')
  730.         self.subwidget_list['dir'] = _dummyComboBox(self, 'dir')
  731.         self.subwidget_list['dirlist'] = _dummyDirList(self, 'dirlist')
  732.         self.subwidget_list['file'] = _dummyComboBox(self, 'file')
  733.         self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist')
  734.  
  735.     
  736.     def filter(self):
  737.         self.tk.call(self._w, 'filter')
  738.  
  739.     
  740.     def invoke(self):
  741.         self.tk.call(self._w, 'invoke')
  742.  
  743.  
  744.  
  745. class DirSelectDialog(TixWidget):
  746.     '''The DirSelectDialog widget presents the directories in the file
  747.     system in a dialog window. The user can use this dialog window to
  748.     navigate through the file system to select the desired directory.
  749.  
  750.     Subwidgets       Class
  751.     ----------       -----
  752.     dirbox       DirSelectDialog'''
  753.     
  754.     def __init__(self, master, cnf = { }, **kw):
  755.         TixWidget.__init__(self, master, 'tixDirSelectDialog', [
  756.             'options'], cnf, kw)
  757.         self.subwidget_list['dirbox'] = _dummyDirSelectBox(self, 'dirbox')
  758.  
  759.     
  760.     def popup(self):
  761.         self.tk.call(self._w, 'popup')
  762.  
  763.     
  764.     def popdown(self):
  765.         self.tk.call(self._w, 'popdown')
  766.  
  767.  
  768.  
  769. class ExFileSelectDialog(TixWidget):
  770.     '''ExFileSelectDialog - MS Windows style file select dialog.
  771.     It provides an convenient method for the user to select files.
  772.  
  773.     Subwidgets       Class
  774.     ----------       -----
  775.     fsbox       ExFileSelectBox'''
  776.     
  777.     def __init__(self, master, cnf = { }, **kw):
  778.         TixWidget.__init__(self, master, 'tixExFileSelectDialog', [
  779.             'options'], cnf, kw)
  780.         self.subwidget_list['fsbox'] = _dummyExFileSelectBox(self, 'fsbox')
  781.  
  782.     
  783.     def popup(self):
  784.         self.tk.call(self._w, 'popup')
  785.  
  786.     
  787.     def popdown(self):
  788.         self.tk.call(self._w, 'popdown')
  789.  
  790.  
  791.  
  792. class FileSelectBox(TixWidget):
  793.     '''ExFileSelectBox - Motif style file select box.
  794.     It is generally used for
  795.     the user to choose a file. FileSelectBox stores the files mostly
  796.     recently selected into a ComboBox widget so that they can be quickly
  797.     selected again.
  798.  
  799.     Subwidget       Class
  800.     ---------       -----
  801.     selection       ComboBox
  802.     filter          ComboBox
  803.     dirlist         ScrolledListBox
  804.     filelist        ScrolledListBox'''
  805.     
  806.     def __init__(self, master, cnf = { }, **kw):
  807.         TixWidget.__init__(self, master, 'tixFileSelectBox', [
  808.             'options'], cnf, kw)
  809.         self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist')
  810.         self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist')
  811.         self.subwidget_list['filter'] = _dummyComboBox(self, 'filter')
  812.         self.subwidget_list['selection'] = _dummyComboBox(self, 'selection')
  813.  
  814.     
  815.     def apply_filter(self):
  816.         self.tk.call(self._w, 'filter')
  817.  
  818.     
  819.     def invoke(self):
  820.         self.tk.call(self._w, 'invoke')
  821.  
  822.  
  823.  
  824. class FileSelectDialog(TixWidget):
  825.     '''FileSelectDialog - Motif style file select dialog.
  826.  
  827.     Subwidgets       Class
  828.     ----------       -----
  829.     btns       StdButtonBox
  830.     fsbox       FileSelectBox'''
  831.     
  832.     def __init__(self, master, cnf = { }, **kw):
  833.         TixWidget.__init__(self, master, 'tixFileSelectDialog', [
  834.             'options'], cnf, kw)
  835.         self.subwidget_list['btns'] = _dummyStdButtonBox(self, 'btns')
  836.         self.subwidget_list['fsbox'] = _dummyFileSelectBox(self, 'fsbox')
  837.  
  838.     
  839.     def popup(self):
  840.         self.tk.call(self._w, 'popup')
  841.  
  842.     
  843.     def popdown(self):
  844.         self.tk.call(self._w, 'popdown')
  845.  
  846.  
  847.  
  848. class FileEntry(TixWidget):
  849.     '''FileEntry - Entry field with button that invokes a FileSelectDialog.
  850.     The user can type in the filename manually. Alternatively, the user can
  851.     press the button widget that sits next to the entry, which will bring
  852.     up a file selection dialog.
  853.  
  854.     Subwidgets       Class
  855.     ----------       -----
  856.     button       Button
  857.     entry       Entry'''
  858.     
  859.     def __init__(self, master, cnf = { }, **kw):
  860.         TixWidget.__init__(self, master, 'tixFileEntry', [
  861.             'dialogtype',
  862.             'options'], cnf, kw)
  863.         self.subwidget_list['button'] = _dummyButton(self, 'button')
  864.         self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
  865.  
  866.     
  867.     def invoke(self):
  868.         self.tk.call(self._w, 'invoke')
  869.  
  870.     
  871.     def file_dialog(self):
  872.         pass
  873.  
  874.  
  875.  
  876. class HList(TixWidget):
  877.     '''HList - Hierarchy display  widget can be used to display any data
  878.     that have a hierarchical structure, for example, file system directory
  879.     trees. The list entries are indented and connected by branch lines
  880.     according to their places in the hierachy.
  881.  
  882.     Subwidgets - None'''
  883.     
  884.     def __init__(self, master = None, cnf = { }, **kw):
  885.         TixWidget.__init__(self, master, 'tixHList', [
  886.             'columns',
  887.             'options'], cnf, kw)
  888.  
  889.     
  890.     def add(self, entry, cnf = { }, **kw):
  891.         return self.tk.call(self._w, 'add', entry, *self._options(cnf, kw))
  892.  
  893.     
  894.     def add_child(self, parent = None, cnf = { }, **kw):
  895.         if not parent:
  896.             parent = ''
  897.         
  898.         return self.tk.call(self._w, 'addchild', parent, *self._options(cnf, kw))
  899.  
  900.     
  901.     def anchor_set(self, entry):
  902.         self.tk.call(self._w, 'anchor', 'set', entry)
  903.  
  904.     
  905.     def anchor_clear(self):
  906.         self.tk.call(self._w, 'anchor', 'clear')
  907.  
  908.     
  909.     def column_width(self, col = 0, width = None, chars = None):
  910.         if not chars:
  911.             return self.tk.call(self._w, 'column', 'width', col, width)
  912.         else:
  913.             return self.tk.call(self._w, 'column', 'width', col, '-char', chars)
  914.  
  915.     
  916.     def delete_all(self):
  917.         self.tk.call(self._w, 'delete', 'all')
  918.  
  919.     
  920.     def delete_entry(self, entry):
  921.         self.tk.call(self._w, 'delete', 'entry', entry)
  922.  
  923.     
  924.     def delete_offsprings(self, entry):
  925.         self.tk.call(self._w, 'delete', 'offsprings', entry)
  926.  
  927.     
  928.     def delete_siblings(self, entry):
  929.         self.tk.call(self._w, 'delete', 'siblings', entry)
  930.  
  931.     
  932.     def dragsite_set(self, index):
  933.         self.tk.call(self._w, 'dragsite', 'set', index)
  934.  
  935.     
  936.     def dragsite_clear(self):
  937.         self.tk.call(self._w, 'dragsite', 'clear')
  938.  
  939.     
  940.     def dropsite_set(self, index):
  941.         self.tk.call(self._w, 'dropsite', 'set', index)
  942.  
  943.     
  944.     def dropsite_clear(self):
  945.         self.tk.call(self._w, 'dropsite', 'clear')
  946.  
  947.     
  948.     def header_create(self, col, cnf = { }, **kw):
  949.         self.tk.call(self._w, 'header', 'create', col, *self._options(cnf, kw))
  950.  
  951.     
  952.     def header_configure(self, col, cnf = { }, **kw):
  953.         if cnf is None:
  954.             return _lst2dict(self.tk.split(self.tk.call(self._w, 'header', 'configure', col)))
  955.         
  956.         self.tk.call(self._w, 'header', 'configure', col, *self._options(cnf, kw))
  957.  
  958.     
  959.     def header_cget(self, col, opt):
  960.         return self.tk.call(self._w, 'header', 'cget', col, opt)
  961.  
  962.     
  963.     def header_exists(self, col):
  964.         return self.tk.call(self._w, 'header', 'exists', col)
  965.  
  966.     
  967.     def header_delete(self, col):
  968.         self.tk.call(self._w, 'header', 'delete', col)
  969.  
  970.     
  971.     def header_size(self, col):
  972.         return self.tk.call(self._w, 'header', 'size', col)
  973.  
  974.     
  975.     def hide_entry(self, entry):
  976.         self.tk.call(self._w, 'hide', 'entry', entry)
  977.  
  978.     
  979.     def indicator_create(self, entry, cnf = { }, **kw):
  980.         self.tk.call(self._w, 'indicator', 'create', entry, *self._options(cnf, kw))
  981.  
  982.     
  983.     def indicator_configure(self, entry, cnf = { }, **kw):
  984.         if cnf is None:
  985.             return _lst2dict(self.tk.split(self.tk.call(self._w, 'indicator', 'configure', entry)))
  986.         
  987.         self.tk.call(self._w, 'indicator', 'configure', entry, *self._options(cnf, kw))
  988.  
  989.     
  990.     def indicator_cget(self, entry, opt):
  991.         return self.tk.call(self._w, 'indicator', 'cget', entry, opt)
  992.  
  993.     
  994.     def indicator_exists(self, entry):
  995.         return self.tk.call(self._w, 'indicator', 'exists', entry)
  996.  
  997.     
  998.     def indicator_delete(self, entry):
  999.         self.tk.call(self._w, 'indicator', 'delete', entry)
  1000.  
  1001.     
  1002.     def indicator_size(self, entry):
  1003.         return self.tk.call(self._w, 'indicator', 'size', entry)
  1004.  
  1005.     
  1006.     def info_anchor(self):
  1007.         return self.tk.call(self._w, 'info', 'anchor')
  1008.  
  1009.     
  1010.     def info_children(self, entry = None):
  1011.         c = self.tk.call(self._w, 'info', 'children', entry)
  1012.         return self.tk.splitlist(c)
  1013.  
  1014.     
  1015.     def info_data(self, entry):
  1016.         return self.tk.call(self._w, 'info', 'data', entry)
  1017.  
  1018.     
  1019.     def info_exists(self, entry):
  1020.         return self.tk.call(self._w, 'info', 'exists', entry)
  1021.  
  1022.     
  1023.     def info_hidden(self, entry):
  1024.         return self.tk.call(self._w, 'info', 'hidden', entry)
  1025.  
  1026.     
  1027.     def info_next(self, entry):
  1028.         return self.tk.call(self._w, 'info', 'next', entry)
  1029.  
  1030.     
  1031.     def info_parent(self, entry):
  1032.         return self.tk.call(self._w, 'info', 'parent', entry)
  1033.  
  1034.     
  1035.     def info_prev(self, entry):
  1036.         return self.tk.call(self._w, 'info', 'prev', entry)
  1037.  
  1038.     
  1039.     def info_selection(self):
  1040.         c = self.tk.call(self._w, 'info', 'selection')
  1041.         return self.tk.splitlist(c)
  1042.  
  1043.     
  1044.     def item_cget(self, entry, col, opt):
  1045.         return self.tk.call(self._w, 'item', 'cget', entry, col, opt)
  1046.  
  1047.     
  1048.     def item_configure(self, entry, col, cnf = { }, **kw):
  1049.         if cnf is None:
  1050.             return _lst2dict(self.tk.split(self.tk.call(self._w, 'item', 'configure', entry, col)))
  1051.         
  1052.         self.tk.call(self._w, 'item', 'configure', entry, col, *self._options(cnf, kw))
  1053.  
  1054.     
  1055.     def item_create(self, entry, col, cnf = { }, **kw):
  1056.         self.tk.call(self._w, 'item', 'create', entry, col, *self._options(cnf, kw))
  1057.  
  1058.     
  1059.     def item_exists(self, entry, col):
  1060.         return self.tk.call(self._w, 'item', 'exists', entry, col)
  1061.  
  1062.     
  1063.     def item_delete(self, entry, col):
  1064.         self.tk.call(self._w, 'item', 'delete', entry, col)
  1065.  
  1066.     
  1067.     def entrycget(self, entry, opt):
  1068.         return self.tk.call(self._w, 'entrycget', entry, opt)
  1069.  
  1070.     
  1071.     def entryconfigure(self, entry, cnf = { }, **kw):
  1072.         if cnf is None:
  1073.             return _lst2dict(self.tk.split(self.tk.call(self._w, 'entryconfigure', entry)))
  1074.         
  1075.         self.tk.call(self._w, 'entryconfigure', entry, *self._options(cnf, kw))
  1076.  
  1077.     
  1078.     def nearest(self, y):
  1079.         return self.tk.call(self._w, 'nearest', y)
  1080.  
  1081.     
  1082.     def see(self, entry):
  1083.         self.tk.call(self._w, 'see', entry)
  1084.  
  1085.     
  1086.     def selection_clear(self, cnf = { }, **kw):
  1087.         self.tk.call(self._w, 'selection', 'clear', *self._options(cnf, kw))
  1088.  
  1089.     
  1090.     def selection_includes(self, entry):
  1091.         return self.tk.call(self._w, 'selection', 'includes', entry)
  1092.  
  1093.     
  1094.     def selection_set(self, first, last = None):
  1095.         self.tk.call(self._w, 'selection', 'set', first, last)
  1096.  
  1097.     
  1098.     def show_entry(self, entry):
  1099.         return self.tk.call(self._w, 'show', 'entry', entry)
  1100.  
  1101.     
  1102.     def xview(self, *args):
  1103.         self.tk.call(self._w, 'xview', *args)
  1104.  
  1105.     
  1106.     def yview(self, *args):
  1107.         self.tk.call(self._w, 'yview', *args)
  1108.  
  1109.  
  1110.  
  1111. class InputOnly(TixWidget):
  1112.     '''InputOnly - Invisible widget. Unix only.
  1113.  
  1114.     Subwidgets - None'''
  1115.     
  1116.     def __init__(self, master = None, cnf = { }, **kw):
  1117.         TixWidget.__init__(self, master, 'tixInputOnly', None, cnf, kw)
  1118.  
  1119.  
  1120.  
  1121. class LabelEntry(TixWidget):
  1122.     """LabelEntry - Entry field with label. Packages an entry widget
  1123.     and a label into one mega widget. It can beused be used to simplify
  1124.     the creation of ``entry-form'' type of interface.
  1125.  
  1126.     Subwidgets       Class
  1127.     ----------       -----
  1128.     label       Label
  1129.     entry       Entry"""
  1130.     
  1131.     def __init__(self, master = None, cnf = { }, **kw):
  1132.         TixWidget.__init__(self, master, 'tixLabelEntry', [
  1133.             'labelside',
  1134.             'options'], cnf, kw)
  1135.         self.subwidget_list['label'] = _dummyLabel(self, 'label')
  1136.         self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
  1137.  
  1138.  
  1139.  
  1140. class LabelFrame(TixWidget):
  1141.     '''LabelFrame - Labelled Frame container. Packages a frame widget
  1142.     and a label into one mega widget. To create widgets inside a
  1143.     LabelFrame widget, one creates the new widgets relative to the
  1144.     frame subwidget and manage them inside the frame subwidget.
  1145.  
  1146.     Subwidgets       Class
  1147.     ----------       -----
  1148.     label       Label
  1149.     frame       Frame'''
  1150.     
  1151.     def __init__(self, master = None, cnf = { }, **kw):
  1152.         TixWidget.__init__(self, master, 'tixLabelFrame', [
  1153.             'labelside',
  1154.             'options'], cnf, kw)
  1155.         self.subwidget_list['label'] = _dummyLabel(self, 'label')
  1156.         self.subwidget_list['frame'] = _dummyFrame(self, 'frame')
  1157.  
  1158.  
  1159.  
  1160. class ListNoteBook(TixWidget):
  1161.     '''A ListNoteBook widget is very similar to the TixNoteBook widget:
  1162.     it can be used to display many windows in a limited space using a
  1163.     notebook metaphor. The notebook is divided into a stack of pages
  1164.     (windows). At one time only one of these pages can be shown.
  1165.     The user can navigate through these pages by
  1166.     choosing the name of the desired page in the hlist subwidget.'''
  1167.     
  1168.     def __init__(self, master, cnf = { }, **kw):
  1169.         TixWidget.__init__(self, master, 'tixListNoteBook', [
  1170.             'options'], cnf, kw)
  1171.         self.subwidget_list['pane'] = _dummyPanedWindow(self, 'pane', destroy_physically = 0)
  1172.         self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
  1173.         self.subwidget_list['shlist'] = _dummyScrolledHList(self, 'shlist')
  1174.  
  1175.     
  1176.     def add(self, name, cnf = { }, **kw):
  1177.         self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
  1178.         self.subwidget_list[name] = TixSubWidget(self, name)
  1179.         return self.subwidget_list[name]
  1180.  
  1181.     
  1182.     def page(self, name):
  1183.         return self.subwidget(name)
  1184.  
  1185.     
  1186.     def pages(self):
  1187.         names = self.tk.split(self.tk.call(self._w, 'pages'))
  1188.         ret = []
  1189.         for x in names:
  1190.             ret.append(self.subwidget(x))
  1191.         
  1192.         return ret
  1193.  
  1194.     
  1195.     def raise_page(self, name):
  1196.         self.tk.call(self._w, 'raise', name)
  1197.  
  1198.  
  1199.  
  1200. class Meter(TixWidget):
  1201.     '''The Meter widget can be used to show the progress of a background
  1202.     job which may take a long time to execute.
  1203.     '''
  1204.     
  1205.     def __init__(self, master = None, cnf = { }, **kw):
  1206.         TixWidget.__init__(self, master, 'tixMeter', [
  1207.             'options'], cnf, kw)
  1208.  
  1209.  
  1210.  
  1211. class NoteBook(TixWidget):
  1212.     '''NoteBook - Multi-page container widget (tabbed notebook metaphor).
  1213.  
  1214.     Subwidgets       Class
  1215.     ----------       -----
  1216.     nbframe       NoteBookFrame
  1217.     <pages>       page widgets added dynamically with the add method'''
  1218.     
  1219.     def __init__(self, master = None, cnf = { }, **kw):
  1220.         TixWidget.__init__(self, master, 'tixNoteBook', [
  1221.             'options'], cnf, kw)
  1222.         self.subwidget_list['nbframe'] = TixSubWidget(self, 'nbframe', destroy_physically = 0)
  1223.  
  1224.     
  1225.     def add(self, name, cnf = { }, **kw):
  1226.         self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
  1227.         self.subwidget_list[name] = TixSubWidget(self, name)
  1228.         return self.subwidget_list[name]
  1229.  
  1230.     
  1231.     def delete(self, name):
  1232.         self.tk.call(self._w, 'delete', name)
  1233.         self.subwidget_list[name].destroy()
  1234.         del self.subwidget_list[name]
  1235.  
  1236.     
  1237.     def page(self, name):
  1238.         return self.subwidget(name)
  1239.  
  1240.     
  1241.     def pages(self):
  1242.         names = self.tk.split(self.tk.call(self._w, 'pages'))
  1243.         ret = []
  1244.         for x in names:
  1245.             ret.append(self.subwidget(x))
  1246.         
  1247.         return ret
  1248.  
  1249.     
  1250.     def raise_page(self, name):
  1251.         self.tk.call(self._w, 'raise', name)
  1252.  
  1253.     
  1254.     def raised(self):
  1255.         return self.tk.call(self._w, 'raised')
  1256.  
  1257.  
  1258.  
  1259. class NoteBookFrame(TixWidget):
  1260.     pass
  1261.  
  1262.  
  1263. class OptionMenu(TixWidget):
  1264.     '''OptionMenu - creates a menu button of options.
  1265.  
  1266.     Subwidget       Class
  1267.     ---------       -----
  1268.     menubutton      Menubutton
  1269.     menu            Menu'''
  1270.     
  1271.     def __init__(self, master, cnf = { }, **kw):
  1272.         TixWidget.__init__(self, master, 'tixOptionMenu', [
  1273.             'options'], cnf, kw)
  1274.         self.subwidget_list['menubutton'] = _dummyMenubutton(self, 'menubutton')
  1275.         self.subwidget_list['menu'] = _dummyMenu(self, 'menu')
  1276.  
  1277.     
  1278.     def add_command(self, name, cnf = { }, **kw):
  1279.         self.tk.call(self._w, 'add', 'command', name, *self._options(cnf, kw))
  1280.  
  1281.     
  1282.     def add_separator(self, name, cnf = { }, **kw):
  1283.         self.tk.call(self._w, 'add', 'separator', name, *self._options(cnf, kw))
  1284.  
  1285.     
  1286.     def delete(self, name):
  1287.         self.tk.call(self._w, 'delete', name)
  1288.  
  1289.     
  1290.     def disable(self, name):
  1291.         self.tk.call(self._w, 'disable', name)
  1292.  
  1293.     
  1294.     def enable(self, name):
  1295.         self.tk.call(self._w, 'enable', name)
  1296.  
  1297.  
  1298.  
  1299. class PanedWindow(TixWidget):
  1300.     '''PanedWindow - Multi-pane container widget
  1301.     allows the user to interactively manipulate the sizes of several
  1302.     panes. The panes can be arranged either vertically or horizontally.The
  1303.     user changes the sizes of the panes by dragging the resize handle
  1304.     between two panes.
  1305.  
  1306.     Subwidgets       Class
  1307.     ----------       -----
  1308.     <panes>       g/p widgets added dynamically with the add method.'''
  1309.     
  1310.     def __init__(self, master, cnf = { }, **kw):
  1311.         TixWidget.__init__(self, master, 'tixPanedWindow', [
  1312.             'orientation',
  1313.             'options'], cnf, kw)
  1314.  
  1315.     
  1316.     def add(self, name, cnf = { }, **kw):
  1317.         self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
  1318.         self.subwidget_list[name] = TixSubWidget(self, name, check_intermediate = 0)
  1319.         return self.subwidget_list[name]
  1320.  
  1321.     
  1322.     def delete(self, name):
  1323.         self.tk.call(self._w, 'delete', name)
  1324.         self.subwidget_list[name].destroy()
  1325.         del self.subwidget_list[name]
  1326.  
  1327.     
  1328.     def forget(self, name):
  1329.         self.tk.call(self._w, 'forget', name)
  1330.  
  1331.     
  1332.     def panecget(self, entry, opt):
  1333.         return self.tk.call(self._w, 'panecget', entry, opt)
  1334.  
  1335.     
  1336.     def paneconfigure(self, entry, cnf = { }, **kw):
  1337.         if cnf is None:
  1338.             return _lst2dict(self.tk.split(self.tk.call(self._w, 'paneconfigure', entry)))
  1339.         
  1340.         self.tk.call(self._w, 'paneconfigure', entry, *self._options(cnf, kw))
  1341.  
  1342.     
  1343.     def panes(self):
  1344.         names = self.tk.call(self._w, 'panes')
  1345.         ret = []
  1346.         for x in names:
  1347.             ret.append(self.subwidget(x))
  1348.         
  1349.         return ret
  1350.  
  1351.  
  1352.  
  1353. class PopupMenu(TixWidget):
  1354.     '''PopupMenu widget can be used as a replacement of the tk_popup command.
  1355.     The advantage of the Tix PopupMenu widget is it requires less application
  1356.     code to manipulate.
  1357.  
  1358.  
  1359.     Subwidgets       Class
  1360.     ----------       -----
  1361.     menubutton       Menubutton
  1362.     menu       Menu'''
  1363.     
  1364.     def __init__(self, master, cnf = { }, **kw):
  1365.         TixWidget.__init__(self, master, 'tixPopupMenu', [
  1366.             'options'], cnf, kw)
  1367.         self.subwidget_list['menubutton'] = _dummyMenubutton(self, 'menubutton')
  1368.         self.subwidget_list['menu'] = _dummyMenu(self, 'menu')
  1369.  
  1370.     
  1371.     def bind_widget(self, widget):
  1372.         self.tk.call(self._w, 'bind', widget._w)
  1373.  
  1374.     
  1375.     def unbind_widget(self, widget):
  1376.         self.tk.call(self._w, 'unbind', widget._w)
  1377.  
  1378.     
  1379.     def post_widget(self, widget, x, y):
  1380.         self.tk.call(self._w, 'post', widget._w, x, y)
  1381.  
  1382.  
  1383.  
  1384. class ResizeHandle(TixWidget):
  1385.     '''Internal widget to draw resize handles on Scrolled widgets.'''
  1386.     
  1387.     def __init__(self, master, cnf = { }, **kw):
  1388.         flags = [
  1389.             'options',
  1390.             'command',
  1391.             'cursorfg',
  1392.             'cursorbg',
  1393.             'handlesize',
  1394.             'hintcolor',
  1395.             'hintwidth',
  1396.             'x',
  1397.             'y']
  1398.         TixWidget.__init__(self, master, 'tixResizeHandle', flags, cnf, kw)
  1399.  
  1400.     
  1401.     def attach_widget(self, widget):
  1402.         self.tk.call(self._w, 'attachwidget', widget._w)
  1403.  
  1404.     
  1405.     def detach_widget(self, widget):
  1406.         self.tk.call(self._w, 'detachwidget', widget._w)
  1407.  
  1408.     
  1409.     def hide(self, widget):
  1410.         self.tk.call(self._w, 'hide', widget._w)
  1411.  
  1412.     
  1413.     def show(self, widget):
  1414.         self.tk.call(self._w, 'show', widget._w)
  1415.  
  1416.  
  1417.  
  1418. class ScrolledHList(TixWidget):
  1419.     '''ScrolledHList - HList with automatic scrollbars.'''
  1420.     
  1421.     def __init__(self, master, cnf = { }, **kw):
  1422.         TixWidget.__init__(self, master, 'tixScrolledHList', [
  1423.             'options'], cnf, kw)
  1424.         self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
  1425.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  1426.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  1427.  
  1428.  
  1429.  
  1430. class ScrolledListBox(TixWidget):
  1431.     '''ScrolledListBox - Listbox with automatic scrollbars.'''
  1432.     
  1433.     def __init__(self, master, cnf = { }, **kw):
  1434.         TixWidget.__init__(self, master, 'tixScrolledListBox', [
  1435.             'options'], cnf, kw)
  1436.         self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox')
  1437.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  1438.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  1439.  
  1440.  
  1441.  
  1442. class ScrolledText(TixWidget):
  1443.     '''ScrolledText - Text with automatic scrollbars.'''
  1444.     
  1445.     def __init__(self, master, cnf = { }, **kw):
  1446.         TixWidget.__init__(self, master, 'tixScrolledText', [
  1447.             'options'], cnf, kw)
  1448.         self.subwidget_list['text'] = _dummyText(self, 'text')
  1449.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  1450.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  1451.  
  1452.  
  1453.  
  1454. class ScrolledTList(TixWidget):
  1455.     '''ScrolledTList - TList with automatic scrollbars.'''
  1456.     
  1457.     def __init__(self, master, cnf = { }, **kw):
  1458.         TixWidget.__init__(self, master, 'tixScrolledTList', [
  1459.             'options'], cnf, kw)
  1460.         self.subwidget_list['tlist'] = _dummyTList(self, 'tlist')
  1461.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  1462.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  1463.  
  1464.  
  1465.  
  1466. class ScrolledWindow(TixWidget):
  1467.     '''ScrolledWindow - Window with automatic scrollbars.'''
  1468.     
  1469.     def __init__(self, master, cnf = { }, **kw):
  1470.         TixWidget.__init__(self, master, 'tixScrolledWindow', [
  1471.             'options'], cnf, kw)
  1472.         self.subwidget_list['window'] = _dummyFrame(self, 'window')
  1473.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  1474.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  1475.  
  1476.  
  1477.  
  1478. class Select(TixWidget):
  1479.     '''Select - Container of button subwidgets. It can be used to provide
  1480.     radio-box or check-box style of selection options for the user.
  1481.  
  1482.     Subwidgets are buttons added dynamically using the add method.'''
  1483.     
  1484.     def __init__(self, master, cnf = { }, **kw):
  1485.         TixWidget.__init__(self, master, 'tixSelect', [
  1486.             'allowzero',
  1487.             'radio',
  1488.             'orientation',
  1489.             'labelside',
  1490.             'options'], cnf, kw)
  1491.         self.subwidget_list['label'] = _dummyLabel(self, 'label')
  1492.  
  1493.     
  1494.     def add(self, name, cnf = { }, **kw):
  1495.         self.tk.call(self._w, 'add', name, *self._options(cnf, kw))
  1496.         self.subwidget_list[name] = _dummyButton(self, name)
  1497.         return self.subwidget_list[name]
  1498.  
  1499.     
  1500.     def invoke(self, name):
  1501.         self.tk.call(self._w, 'invoke', name)
  1502.  
  1503.  
  1504.  
  1505. class Shell(TixWidget):
  1506.     '''Toplevel window.
  1507.  
  1508.     Subwidgets - None'''
  1509.     
  1510.     def __init__(self, master = None, cnf = { }, **kw):
  1511.         TixWidget.__init__(self, master, 'tixShell', [
  1512.             'options',
  1513.             'title'], cnf, kw)
  1514.  
  1515.  
  1516.  
  1517. class DialogShell(TixWidget):
  1518.     '''Toplevel window, with popup popdown and center methods.
  1519.     It tells the window manager that it is a dialog window and should be
  1520.     treated specially. The exact treatment depends on the treatment of
  1521.     the window manager.
  1522.  
  1523.     Subwidgets - None'''
  1524.     
  1525.     def __init__(self, master = None, cnf = { }, **kw):
  1526.         TixWidget.__init__(self, master, 'tixDialogShell', [
  1527.             'options',
  1528.             'title',
  1529.             'mapped',
  1530.             'minheight',
  1531.             'minwidth',
  1532.             'parent',
  1533.             'transient'], cnf, kw)
  1534.  
  1535.     
  1536.     def popdown(self):
  1537.         self.tk.call(self._w, 'popdown')
  1538.  
  1539.     
  1540.     def popup(self):
  1541.         self.tk.call(self._w, 'popup')
  1542.  
  1543.     
  1544.     def center(self):
  1545.         self.tk.call(self._w, 'center')
  1546.  
  1547.  
  1548.  
  1549. class StdButtonBox(TixWidget):
  1550.     '''StdButtonBox - Standard Button Box (OK, Apply, Cancel and Help) '''
  1551.     
  1552.     def __init__(self, master = None, cnf = { }, **kw):
  1553.         TixWidget.__init__(self, master, 'tixStdButtonBox', [
  1554.             'orientation',
  1555.             'options'], cnf, kw)
  1556.         self.subwidget_list['ok'] = _dummyButton(self, 'ok')
  1557.         self.subwidget_list['apply'] = _dummyButton(self, 'apply')
  1558.         self.subwidget_list['cancel'] = _dummyButton(self, 'cancel')
  1559.         self.subwidget_list['help'] = _dummyButton(self, 'help')
  1560.  
  1561.     
  1562.     def invoke(self, name):
  1563.         if self.subwidget_list.has_key(name):
  1564.             self.tk.call(self._w, 'invoke', name)
  1565.         
  1566.  
  1567.  
  1568.  
  1569. class TList(TixWidget):
  1570.     '''TList - Hierarchy display widget which can be
  1571.     used to display data in a tabular format. The list entries of a TList
  1572.     widget are similar to the entries in the Tk listbox widget. The main
  1573.     differences are (1) the TList widget can display the list entries in a
  1574.     two dimensional format and (2) you can use graphical images as well as
  1575.     multiple colors and fonts for the list entries.
  1576.  
  1577.     Subwidgets - None'''
  1578.     
  1579.     def __init__(self, master = None, cnf = { }, **kw):
  1580.         TixWidget.__init__(self, master, 'tixTList', [
  1581.             'options'], cnf, kw)
  1582.  
  1583.     
  1584.     def active_set(self, index):
  1585.         self.tk.call(self._w, 'active', 'set', index)
  1586.  
  1587.     
  1588.     def active_clear(self):
  1589.         self.tk.call(self._w, 'active', 'clear')
  1590.  
  1591.     
  1592.     def anchor_set(self, index):
  1593.         self.tk.call(self._w, 'anchor', 'set', index)
  1594.  
  1595.     
  1596.     def anchor_clear(self):
  1597.         self.tk.call(self._w, 'anchor', 'clear')
  1598.  
  1599.     
  1600.     def delete(self, from_, to = None):
  1601.         self.tk.call(self._w, 'delete', from_, to)
  1602.  
  1603.     
  1604.     def dragsite_set(self, index):
  1605.         self.tk.call(self._w, 'dragsite', 'set', index)
  1606.  
  1607.     
  1608.     def dragsite_clear(self):
  1609.         self.tk.call(self._w, 'dragsite', 'clear')
  1610.  
  1611.     
  1612.     def dropsite_set(self, index):
  1613.         self.tk.call(self._w, 'dropsite', 'set', index)
  1614.  
  1615.     
  1616.     def dropsite_clear(self):
  1617.         self.tk.call(self._w, 'dropsite', 'clear')
  1618.  
  1619.     
  1620.     def insert(self, index, cnf = { }, **kw):
  1621.         self.tk.call(self._w, 'insert', index, *self._options(cnf, kw))
  1622.  
  1623.     
  1624.     def info_active(self):
  1625.         return self.tk.call(self._w, 'info', 'active')
  1626.  
  1627.     
  1628.     def info_anchor(self):
  1629.         return self.tk.call(self._w, 'info', 'anchor')
  1630.  
  1631.     
  1632.     def info_down(self, index):
  1633.         return self.tk.call(self._w, 'info', 'down', index)
  1634.  
  1635.     
  1636.     def info_left(self, index):
  1637.         return self.tk.call(self._w, 'info', 'left', index)
  1638.  
  1639.     
  1640.     def info_right(self, index):
  1641.         return self.tk.call(self._w, 'info', 'right', index)
  1642.  
  1643.     
  1644.     def info_selection(self):
  1645.         c = self.tk.call(self._w, 'info', 'selection')
  1646.         return self.tk.splitlist(c)
  1647.  
  1648.     
  1649.     def info_size(self):
  1650.         return self.tk.call(self._w, 'info', 'size')
  1651.  
  1652.     
  1653.     def info_up(self, index):
  1654.         return self.tk.call(self._w, 'info', 'up', index)
  1655.  
  1656.     
  1657.     def nearest(self, x, y):
  1658.         return self.tk.call(self._w, 'nearest', x, y)
  1659.  
  1660.     
  1661.     def see(self, index):
  1662.         self.tk.call(self._w, 'see', index)
  1663.  
  1664.     
  1665.     def selection_clear(self, cnf = { }, **kw):
  1666.         self.tk.call(self._w, 'selection', 'clear', *self._options(cnf, kw))
  1667.  
  1668.     
  1669.     def selection_includes(self, index):
  1670.         return self.tk.call(self._w, 'selection', 'includes', index)
  1671.  
  1672.     
  1673.     def selection_set(self, first, last = None):
  1674.         self.tk.call(self._w, 'selection', 'set', first, last)
  1675.  
  1676.     
  1677.     def xview(self, *args):
  1678.         self.tk.call(self._w, 'xview', *args)
  1679.  
  1680.     
  1681.     def yview(self, *args):
  1682.         self.tk.call(self._w, 'yview', *args)
  1683.  
  1684.  
  1685.  
  1686. class Tree(TixWidget):
  1687.     '''Tree - The tixTree widget can be used to display hierachical
  1688.     data in a tree form. The user can adjust
  1689.     the view of the tree by opening or closing parts of the tree.'''
  1690.     
  1691.     def __init__(self, master = None, cnf = { }, **kw):
  1692.         TixWidget.__init__(self, master, 'tixTree', [
  1693.             'options'], cnf, kw)
  1694.         self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
  1695.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  1696.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  1697.  
  1698.     
  1699.     def autosetmode(self):
  1700.         '''This command calls the setmode method for all the entries in this
  1701.      Tree widget: if an entry has no child entries, its mode is set to
  1702.      none. Otherwise, if the entry has any hidden child entries, its mode is
  1703.      set to open; otherwise its mode is set to close.'''
  1704.         self.tk.call(self._w, 'autosetmode')
  1705.  
  1706.     
  1707.     def close(self, entrypath):
  1708.         '''Close the entry given by entryPath if its mode is close.'''
  1709.         self.tk.call(self._w, 'close', entrypath)
  1710.  
  1711.     
  1712.     def getmode(self, entrypath):
  1713.         '''Returns the current mode of the entry given by entryPath.'''
  1714.         return self.tk.call(self._w, 'getmode', entrypath)
  1715.  
  1716.     
  1717.     def open(self, entrypath):
  1718.         '''Open the entry given by entryPath if its mode is open.'''
  1719.         self.tk.call(self._w, 'open', entrypath)
  1720.  
  1721.     
  1722.     def setmode(self, entrypath, mode = 'none'):
  1723.         '''This command is used to indicate whether the entry given by
  1724.      entryPath has children entries and whether the children are visible. mode
  1725.      must be one of open, close or none. If mode is set to open, a (+)
  1726.      indicator is drawn next the the entry. If mode is set to close, a (-)
  1727.      indicator is drawn next the the entry. If mode is set to none, no
  1728.      indicators will be drawn for this entry. The default mode is none. The
  1729.      open mode indicates the entry has hidden children and this entry can be
  1730.      opened by the user. The close mode indicates that all the children of the
  1731.      entry are now visible and the entry can be closed by the user.'''
  1732.         self.tk.call(self._w, 'setmode', entrypath, mode)
  1733.  
  1734.  
  1735.  
  1736. class CheckList(TixWidget):
  1737.     '''The CheckList widget
  1738.     displays a list of items to be selected by the user. CheckList acts
  1739.     similarly to the Tk checkbutton or radiobutton widgets, except it is
  1740.     capable of handling many more items than checkbuttons or radiobuttons.
  1741.     '''
  1742.     
  1743.     def __init__(self, master = None, cnf = { }, **kw):
  1744.         TixWidget.__init__(self, master, 'tixCheckList', [
  1745.             'options'], cnf, kw)
  1746.         self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
  1747.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  1748.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  1749.  
  1750.     
  1751.     def autosetmode(self):
  1752.         '''This command calls the setmode method for all the entries in this
  1753.      Tree widget: if an entry has no child entries, its mode is set to
  1754.      none. Otherwise, if the entry has any hidden child entries, its mode is
  1755.      set to open; otherwise its mode is set to close.'''
  1756.         self.tk.call(self._w, 'autosetmode')
  1757.  
  1758.     
  1759.     def close(self, entrypath):
  1760.         '''Close the entry given by entryPath if its mode is close.'''
  1761.         self.tk.call(self._w, 'close', entrypath)
  1762.  
  1763.     
  1764.     def getmode(self, entrypath):
  1765.         '''Returns the current mode of the entry given by entryPath.'''
  1766.         return self.tk.call(self._w, 'getmode', entrypath)
  1767.  
  1768.     
  1769.     def open(self, entrypath):
  1770.         '''Open the entry given by entryPath if its mode is open.'''
  1771.         self.tk.call(self._w, 'open', entrypath)
  1772.  
  1773.     
  1774.     def getselection(self, mode = 'on'):
  1775.         '''Returns a list of items whose status matches status. If status is
  1776.      not specified, the list of items in the "on" status will be returned.
  1777.      Mode can be on, off, default'''
  1778.         c = self.tk.split(self.tk.call(self._w, 'getselection', mode))
  1779.         return self.tk.splitlist(c)
  1780.  
  1781.     
  1782.     def getstatus(self, entrypath):
  1783.         '''Returns the current status of entryPath.'''
  1784.         return self.tk.call(self._w, 'getstatus', entrypath)
  1785.  
  1786.     
  1787.     def setstatus(self, entrypath, mode = 'on'):
  1788.         '''Sets the status of entryPath to be status. A bitmap will be
  1789.      displayed next to the entry its status is on, off or default.'''
  1790.         self.tk.call(self._w, 'setstatus', entrypath, mode)
  1791.  
  1792.  
  1793.  
  1794. class _dummyButton(Button, TixSubWidget):
  1795.     
  1796.     def __init__(self, master, name, destroy_physically = 1):
  1797.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1798.  
  1799.  
  1800.  
  1801. class _dummyCheckbutton(Checkbutton, TixSubWidget):
  1802.     
  1803.     def __init__(self, master, name, destroy_physically = 1):
  1804.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1805.  
  1806.  
  1807.  
  1808. class _dummyEntry(Entry, TixSubWidget):
  1809.     
  1810.     def __init__(self, master, name, destroy_physically = 1):
  1811.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1812.  
  1813.  
  1814.  
  1815. class _dummyFrame(Frame, TixSubWidget):
  1816.     
  1817.     def __init__(self, master, name, destroy_physically = 1):
  1818.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1819.  
  1820.  
  1821.  
  1822. class _dummyLabel(Label, TixSubWidget):
  1823.     
  1824.     def __init__(self, master, name, destroy_physically = 1):
  1825.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1826.  
  1827.  
  1828.  
  1829. class _dummyListbox(Listbox, TixSubWidget):
  1830.     
  1831.     def __init__(self, master, name, destroy_physically = 1):
  1832.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1833.  
  1834.  
  1835.  
  1836. class _dummyMenu(Menu, TixSubWidget):
  1837.     
  1838.     def __init__(self, master, name, destroy_physically = 1):
  1839.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1840.  
  1841.  
  1842.  
  1843. class _dummyMenubutton(Menubutton, TixSubWidget):
  1844.     
  1845.     def __init__(self, master, name, destroy_physically = 1):
  1846.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1847.  
  1848.  
  1849.  
  1850. class _dummyScrollbar(Scrollbar, TixSubWidget):
  1851.     
  1852.     def __init__(self, master, name, destroy_physically = 1):
  1853.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1854.  
  1855.  
  1856.  
  1857. class _dummyText(Text, TixSubWidget):
  1858.     
  1859.     def __init__(self, master, name, destroy_physically = 1):
  1860.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1861.  
  1862.  
  1863.  
  1864. class _dummyScrolledListBox(ScrolledListBox, TixSubWidget):
  1865.     
  1866.     def __init__(self, master, name, destroy_physically = 1):
  1867.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1868.         self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox')
  1869.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  1870.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  1871.  
  1872.  
  1873.  
  1874. class _dummyHList(HList, TixSubWidget):
  1875.     
  1876.     def __init__(self, master, name, destroy_physically = 1):
  1877.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1878.  
  1879.  
  1880.  
  1881. class _dummyScrolledHList(ScrolledHList, TixSubWidget):
  1882.     
  1883.     def __init__(self, master, name, destroy_physically = 1):
  1884.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1885.         self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
  1886.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  1887.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  1888.  
  1889.  
  1890.  
  1891. class _dummyTList(TList, TixSubWidget):
  1892.     
  1893.     def __init__(self, master, name, destroy_physically = 1):
  1894.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1895.  
  1896.  
  1897.  
  1898. class _dummyComboBox(ComboBox, TixSubWidget):
  1899.     
  1900.     def __init__(self, master, name, destroy_physically = 1):
  1901.         TixSubWidget.__init__(self, master, name, [
  1902.             'fancy',
  1903.             destroy_physically])
  1904.         self.subwidget_list['label'] = _dummyLabel(self, 'label')
  1905.         self.subwidget_list['entry'] = _dummyEntry(self, 'entry')
  1906.         self.subwidget_list['arrow'] = _dummyButton(self, 'arrow')
  1907.         self.subwidget_list['slistbox'] = _dummyScrolledListBox(self, 'slistbox')
  1908.         
  1909.         try:
  1910.             self.subwidget_list['tick'] = _dummyButton(self, 'tick')
  1911.             self.subwidget_list['cross'] = _dummyButton(self, 'cross')
  1912.         except TypeError:
  1913.             pass
  1914.  
  1915.  
  1916.  
  1917.  
  1918. class _dummyDirList(DirList, TixSubWidget):
  1919.     
  1920.     def __init__(self, master, name, destroy_physically = 1):
  1921.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1922.         self.subwidget_list['hlist'] = _dummyHList(self, 'hlist')
  1923.         self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb')
  1924.         self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb')
  1925.  
  1926.  
  1927.  
  1928. class _dummyDirSelectBox(DirSelectBox, TixSubWidget):
  1929.     
  1930.     def __init__(self, master, name, destroy_physically = 1):
  1931.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1932.         self.subwidget_list['dirlist'] = _dummyDirList(self, 'dirlist')
  1933.         self.subwidget_list['dircbx'] = _dummyFileComboBox(self, 'dircbx')
  1934.  
  1935.  
  1936.  
  1937. class _dummyExFileSelectBox(ExFileSelectBox, TixSubWidget):
  1938.     
  1939.     def __init__(self, master, name, destroy_physically = 1):
  1940.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1941.         self.subwidget_list['cancel'] = _dummyButton(self, 'cancel')
  1942.         self.subwidget_list['ok'] = _dummyButton(self, 'ok')
  1943.         self.subwidget_list['hidden'] = _dummyCheckbutton(self, 'hidden')
  1944.         self.subwidget_list['types'] = _dummyComboBox(self, 'types')
  1945.         self.subwidget_list['dir'] = _dummyComboBox(self, 'dir')
  1946.         self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist')
  1947.         self.subwidget_list['file'] = _dummyComboBox(self, 'file')
  1948.         self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist')
  1949.  
  1950.  
  1951.  
  1952. class _dummyFileSelectBox(FileSelectBox, TixSubWidget):
  1953.     
  1954.     def __init__(self, master, name, destroy_physically = 1):
  1955.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1956.         self.subwidget_list['dirlist'] = _dummyScrolledListBox(self, 'dirlist')
  1957.         self.subwidget_list['filelist'] = _dummyScrolledListBox(self, 'filelist')
  1958.         self.subwidget_list['filter'] = _dummyComboBox(self, 'filter')
  1959.         self.subwidget_list['selection'] = _dummyComboBox(self, 'selection')
  1960.  
  1961.  
  1962.  
  1963. class _dummyFileComboBox(ComboBox, TixSubWidget):
  1964.     
  1965.     def __init__(self, master, name, destroy_physically = 1):
  1966.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1967.         self.subwidget_list['dircbx'] = _dummyComboBox(self, 'dircbx')
  1968.  
  1969.  
  1970.  
  1971. class _dummyStdButtonBox(StdButtonBox, TixSubWidget):
  1972.     
  1973.     def __init__(self, master, name, destroy_physically = 1):
  1974.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1975.         self.subwidget_list['ok'] = _dummyButton(self, 'ok')
  1976.         self.subwidget_list['apply'] = _dummyButton(self, 'apply')
  1977.         self.subwidget_list['cancel'] = _dummyButton(self, 'cancel')
  1978.         self.subwidget_list['help'] = _dummyButton(self, 'help')
  1979.  
  1980.  
  1981.  
  1982. class _dummyNoteBookFrame(NoteBookFrame, TixSubWidget):
  1983.     
  1984.     def __init__(self, master, name, destroy_physically = 0):
  1985.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1986.  
  1987.  
  1988.  
  1989. class _dummyPanedWindow(PanedWindow, TixSubWidget):
  1990.     
  1991.     def __init__(self, master, name, destroy_physically = 1):
  1992.         TixSubWidget.__init__(self, master, name, destroy_physically)
  1993.  
  1994.  
  1995.  
  1996. def OptionName(widget):
  1997.     '''Returns the qualified path name for the widget. Normally used to set
  1998.     default options for subwidgets. See tixwidgets.py'''
  1999.     return widget.tk.call('tixOptionName', widget._w)
  2000.  
  2001.  
  2002. def FileTypeList(dict):
  2003.     s = ''
  2004.     for type in dict.keys():
  2005.         s = s + '{{' + type + '} {' + type + ' - ' + dict[type] + '}} '
  2006.     
  2007.     return s
  2008.  
  2009.  
  2010. class CObjView(TixWidget):
  2011.     '''This file implements the Canvas Object View widget. This is a base
  2012.     class of IconView. It implements automatic placement/adjustment of the
  2013.     scrollbars according to the canvas objects inside the canvas subwidget.
  2014.     The scrollbars are adjusted so that the canvas is just large enough
  2015.     to see all the objects.
  2016.     '''
  2017.     pass
  2018.  
  2019.  
  2020. class Grid(TixWidget):
  2021.     '''The Tix Grid command creates a new window  and makes it into a
  2022.     tixGrid widget. Additional options, may be specified on the command
  2023.     line or in the option database to configure aspects such as its cursor
  2024.     and relief.
  2025.  
  2026.     A Grid widget displays its contents in a two dimensional grid of cells.
  2027.     Each cell may contain one Tix display item, which may be in text,
  2028.     graphics or other formats. See the DisplayStyle class for more information
  2029.     about Tix display items. Individual cells, or groups of cells, can be
  2030.     formatted with a wide range of attributes, such as its color, relief and
  2031.     border.
  2032.  
  2033.     Subwidgets - None'''
  2034.     pass
  2035.  
  2036.  
  2037. class ScrolledGrid(TixWidget):
  2038.     '''Scrolled Grid widgets'''
  2039.     pass
  2040.  
  2041.